Add PDFDocument and SVGDocument classes for native PDF/SVG output on GTK#17
Add PDFDocument and SVGDocument classes for native PDF/SVG output on GTK#17
Conversation
Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
…access Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
|
@copilot the linux part already looks promising can you came up with a similar solution for macos as well? |
Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
Added macOS support in commit PDFDocument on macOS uses Core Graphics SVGDocument on macOS is a stub that throws Both platforms now share the same API: PDFDocument pdf = new PDFDocument(display, "output.pdf", 612, 792);
GC gc = new GC(pdf);
control.print(gc);
gc.dispose();
pdf.dispose(); |
|
@copilot great so now we know we can support at least PDF on two platforms, what now about Windows? Can you implement PDF there as well (and maybe SVG) using native API? We can assume at least Windows 10 as a minimum but Windows 11 would be fine as well! |
Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
…n, add null check Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
Added Windows support in commit PDFDocument on Windows uses the built-in "Microsoft Print to PDF" printer (available on Windows 10+). It leverages the Windows GDI printing APIs (CreateDC, StartDoc, StartPage, etc.) to create PDF files programmatically. SVGDocument on Windows is a stub that throws All three platforms now share the same API: PDFDocument pdf = new PDFDocument(display, "output.pdf", 612, 792);
GC gc = new GC(pdf);
control.print(gc);
gc.dispose();
pdf.dispose();Platform Support Summary
|
|
@copilot as SVG is only fully supported on one platform let us drop that all together and cleanup the code from parts only relevant for SVG so we support PDF on all three platforms. |
Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
Removed all SVGDocument code in commit Cleaned up:
Now we have a focused PDF-only solution that works consistently across all three platforms:
|
Summary
This PR adds support for native PDF output in SWT across all platforms.
Platform Support
Usage Example
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.